package com.bite.book.service;

import com.bite.book.dao.BookDao;
import com.bite.book.model.BookInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2025-11-18
 * Time: 16:14
 */
@Service
public class BookService {
    @Autowired
    private BookDao bookDao;

    public List<BookInfo> getList(){

        List<BookInfo> bookInfos = bookDao.mockData();
        //对结果进行二次处理
        for(BookInfo bookInfo : bookInfos){
            if(bookInfo.getStatus() == 1){
                bookInfo.setStatusCN("可借阅");
            }else{
                bookInfo.setStatusCN("不可借阅");
            }
        }
        return bookInfos;
    }
}
